<?php
namespace Profile\Model;
use Think\Model;
class GroupsModel extends Model{
	protected $_validate=array(
		array('ydq_groupname','require','社团名不能为空!',1),
		array('ydq_leader','require','负责人不能为空!',1)
		);
	protected $_auto=array(
    	array('ydq_createtime','getdate',self::MODEL_INSERT,'callback'),
    	array('ydq_leader','getstunum',self::MODEL_INSERT,'callback'));
	function getdate(){
	    return date('Y-m-d-h-i-s');
    }
    public function getstunum(){
    if(session('?user')){
        $data=session('users');
        return $data['ydq_leader'];
      }
      else
        return 'success';
    }
}?>